Accessing Draw Widget Events

To go beyond merely displaying an image in a draw widget and allow the user to interact in some way with the displayed image, you must configure the draw widget to generate either button, motion, wheel, or keyboard events:

The following example uses motion events to update the values of several label widgets as the mouse cursor moves over an image in a draw widget. This and several other features are discussed in the section following the code.

See the file draw_widget_data.pro in the examples/doc/widgets subdirectory of the IDL distribution for the example code. Run this example procedure by entering draw_widget_data at the IDL command prompt or view the file in an IDL Editor window by entering .EDIT draw_widget_data.pro. See Running the Example Code if IDL does not run the program as expected. You may need to enter DEVICE, DECOMPOSED=1 at the IDL command prompt before running this example.

The following things about this example are worth noting: